package com.cysyz.mylib.tplgenerator;

import com.cysyz.mylib.tplgenerator.impl.struts2.IfReplaceAdapter;
import com.cysyz.mylib.tplgenerator.impl.struts2.IncludeReplacAdapter;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by emall on 2014/8/18.
 */
public class TplGenerator {
    private List<ReplaceAdapter> replaceAdapters = new ArrayList<ReplaceAdapter>();
    public TplGenerator() {
        replaceAdapters.add(new IncludeReplacAdapter());
        replaceAdapters.add(new IfReplaceAdapter());
    }

    public static void main(String[] args) {
        TplGenerator main = new TplGenerator();
        String pathname = "D:\\Desktop\\workspace\\idea_workspace\\Emall\\WebContent\\front\\org_courses.jsp";

        main.generate(pathname);

    }

    public void generate(String pathname) {
        /*StringBuffer content = null;
        try {
            content = new StringBuffer(FileUtils.readFileToString(new File(pathname)));
            for (ReplaceAdapter replaceAdapter : replaceAdapters) {
                content = replaceAdapter.process(content);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }*/
    }
}
